package com.tledu.springboot04.core.model;

import lombok.Data;

@Data
public class AjaxResult<T> {
    private boolean success;
    private String msg;
    private Integer code;
    private T data;

    public AjaxResult() {
        this.success = true;
        this.code = 200;
        this.msg = "操作成功";
    }

    public AjaxResult(String msg) {
        this.success = true;
        this.code = 200;
        this.msg = msg;
    }

    public AjaxResult(String msg, Integer code) {
        this.success = false;
        this.msg = msg;
        this.code = code;
    }

    public AjaxResult(T data) {
        this.success = true;
        this.code = 200;
        this.data = data;
    }
}
